package com.toe.pojo.entity.user;

import com.baomidou.mybatisplus.annotation.IdType;

import java.time.LocalDateTime;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.*;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author 陶涛
 * @since 2022-07-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UserUsertbl对象", description="用户表")
public class UserUsertbl implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "账号",required = true)
    private String account;

    @ApiModelProperty(value = "用户名(真实姓名)",required = true,position = 1)
    @NotBlank(message = "用户名不能为空!")
    private String username;

    @ApiModelProperty(value = "密码（密文）",required = true,position = 2)
    @NotBlank(message = "密码不能为空!")
    @Pattern(regexp = "^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$).{6,20}$",message = "密码必须由6-20位数字,英文,字符中的两种以上组成!")
    private String password;

    @NotBlank(message = "昵称不能为空!")
    @ApiModelProperty(value = "昵称",position = 3)
    private String nickname;

    @ApiModelProperty(value = "头像URL",position = 4)
    private String avatar;

    @ApiModelProperty(value = "背景图片URL",position = 5)
    private String background;

    @ApiModelProperty(value = "性别",position = 6)
    private String sex;

    @ApiModelProperty(value = "出生日期",position = 7)
    @Past(message = "请输入正确的生日！")
    @JsonFormat(pattern ="yyyy-MM-dd",timezone ="GMT+8")
    private Date birthday;

    @ApiModelProperty(value = "身高",required = true,position = 8)
    private Double height;


    @ApiModelProperty(value = "体重",required = true,position = 9)
    private Double weight;

    @ApiModelProperty(value = "bmi值",position = 10)
    private Double bmi;

    @ApiModelProperty(value = "手机号码",required = true,position = 11)
    @Pattern(regexp = "^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$",message = "请输入正确的电话号码!")
    private String phone;

    @ApiModelProperty(value = "电子邮箱",required = true,position = 12)
    @Pattern(regexp = "^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$",message = "请输入正确的电子邮箱地址!")
    private String email;

    @ApiModelProperty(value = "个人描述",position = 13)
    private String description;

    @ApiModelProperty(value = "爱心值",position = 14)
    private Integer loveValue;

    @ApiModelProperty(value = "是否启用，1=启用，0=未启用",position = 15)
    private Integer isEnable;

    @ApiModelProperty(value = "数据创建时间",position = 16)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "数据最后修改时间",position = 17)
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;


}
